using System;
using System.Collections.ObjectModel;

namespace RandomSearch.Common {
    public sealed class DisposableCollection : Collection<IDisposable>, IDisposable {
        #region IDisposable Members

        public void Dispose() {
            foreach (IDisposable obj in this)
                if (null != obj) obj.Dispose();
            Clear();
        }

        #endregion
    }
}